/*
 * +----------------------------------------------------------------------
 * | Copyright (c) 奇特物联 2021-2022 All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed 未经许可不能去掉「奇特物联」相关版权
 * +----------------------------------------------------------------------
 * | Author: xw2sy@163.com
 * +----------------------------------------------------------------------
 */
package cc.iotkit.data.service;

import cc.iotkit.common.api.Paging;
import cc.iotkit.data.mapper.IJPACommData;
import cc.iotkit.data.manager.IProtocolConverterData;
import cc.iotkit.data.model.TbProtocolConverter;
import cc.iotkit.model.protocol.ProtocolConverter;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Primary
@Service
public class ProtocolConverterDataImpl implements IProtocolConverterData, IJPACommData<ProtocolConverter, String, TbProtocolConverter> {

    @Resource
    private ProtocolConverterService protocolConverterService;

    @Override
    public ProtocolConverterService getBaseRepository() {
        return protocolConverterService;
    }

    @Override
    public Class getJpaRepositoryClass() {
        return TbProtocolConverter.class;
    }

    @Override
    public Class getTClass() {
        return ProtocolConverter.class;
    }

    @Override
    public List<ProtocolConverter> findByUid(String uid) {
        return protocolConverterService.findByUid(uid);
    }

    @Override
    public Paging<ProtocolConverter> findByUid(String uid, int page, int size) {
        return protocolConverterService.findByUid(uid, page, size);
    }

    @Override
    public long countByUid(String uid) {
        return protocolConverterService.countByUid(uid);
    }

}
